package com.mate.cloud.lottery.constants;


/**
 * redis 缓存key 统一管理
 *
 * @author: MI
 * @email: 448341911@qq.com
 * @createTime: 2025/8/30 13:12
 * @updateUser: MI
 * @updateTime: 2025/8/30 13:12
 * @updateRemark: 修改内容
 * @version: 1.0
 */
public class RedisKeyManager {

    /**
     * 正在抽奖的key
     *
     * @param accountIp
     * @return
     */
    public static String getDrawingRedisKey(String accountIp) {
        return String.format(LotteryConstants.DRAWING, accountIp);
    }

    /**
     * 获取抽奖活动的key
     *
     * @param id
     * @return
     */
    public static String getLotteryRedisKey(Integer id) {
        return String.format(LotteryConstants.LOTTERY_ID, id);
    }

    /**
     * 获取指定活动下的所有奖品数据
     *
     * @param lotteryId
     * @return
     */
    public static String getLotteryPrizeRedisKey(Integer lotteryId) {
        return String.format(LotteryConstants.LOTTERY_PRIZE, lotteryId);
    }

    public static String getLotteryPrizeRedisKey(Integer lotteryId, Integer prizeId) {
        return String.format(LotteryConstants.LOTTERY_PRIZE_LOTTERY_ID, lotteryId, prizeId);
    }

    public static String getDefaultLotteryPrizeRedisKey(Integer lotteryId) {
        return String.format(LotteryConstants.DEFAULT_LOTTERY_PRIZE, lotteryId);
    }

    public static String getLotteryItemRedisKey(Integer lotteryId) {
        return String.format(LotteryConstants.LOTTERY_ITEM, lotteryId);
    }

    public static String getDefaultLotteryItemRedisKey(Integer lotteryId) {
        return String.format(LotteryConstants.DEFAULT_LOTTERY_ITEM, lotteryId);
    }
}
